﻿//
// Created by 11510 on 2024/6/18.
//
#include <iostream>
using namespace std;


class Base {
public:
    virtual void print() const {
        cout << "_base:" << _base << endl;
    }

protected:
    Base(int base) : _base(base) {
        cout << "Base()" << endl;
    }

    int _base;
};

class Derived : public Base {
public:
    Derived(int base, int derived) :
            Base(base), _derived(derived) {
        cout << "Derived(int,int)" << endl;
    }

    void print() const {
        cout << "_base:" << _base
             << ", _derived:" << _derived << endl;
    }

private:
    int _derived;
};

void test0() {
//    Base base(1);//error
    Derived derived(4, 8);
}


int main() {
    test0();
}
